// pages/manage/manage.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    sign: null,
    ispopupShow: false,
    GlStateOneValue: '',
    GlStateOneIndex:0,
    GlStateTwoValue: '',
    GlStateTwoIndex:0,
    StepperValue:1,
    currentValue:50,
    weuiValue:'',
    customStyleSelect: "padding:0 0 0 20rpx;height: 100%;width:100%;color:#808285;",
    columnsGlStateOne:[{
      id: 0,
      text: '选择功率'
    }, {
      id: 1,
      text: '1~100'
    }, {
      id: 2,
      text: '101~200'
    }],
    columnsGlStateTwo:[{
      id: 0,
      text: '选择功率'
    }, {
      id: 1,
      text: '1~100'
    }, {
      id: 2,
      text: '101~200'
    }, {
      id: 3,
      text: '201~300'
    }],
  },
  onDrag(event) {
    let that = this
    that.setData({
      currentValue: event.detail.value,
    });
  },
  onStepper(event) {
    let that = this
    that .setData({
      StepperValue:event.detail
    })
    console.log(event.detail);
  },
  onClickInput(e) {
    let that = this
    that.setData({
      sign: e.currentTarget.dataset.sign,
      ispopupShow: true
    })
  },
  cancelpicker(e) {
    let that = this
    that.setData({
      ispopupShow: false
    })
    setTimeout(()=>{
      that.setData({
        sign:null
      })
    },200)
  },
  onConfirmGlStateOne(event) {
    let that = this
    that.setData({
      GlStateOneIndex:event.detail.index,
      GlStateOneValue: event.detail.value.id == 0 ? '' : event.detail.value.text,
      ispopupShow: false
    })
  },
  onConfirmGlStateTwo(event) {
    let that = this
    that.setData({
      GlStateTwoIndex:event.detail.index,
      GlStateTwoValue: event.detail.value.id == 0 ? '' : event.detail.value.text,
      ispopupShow: false
    })
  },
  bindHideKeyboard(e){
    let that = this
    that.setData({
      weuiValue:e.detail.value
    })
  },
  submit(){
    let that = this
    let params = {}
    params.currentValue = that.data.currentValue
    params.StepperValue = that.data.StepperValue
    params.GlStateOneIndex = that.data.GlStateOneIndex
    params.GlStateTwoIndex = that.data.GlStateTwoIndex
    params.weuiValue = that.data.weuiValue
    console.log(params);
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})